#Program modified to get total average for all tests: # This program averages test scores. It asks the user for the number of students and number of scores per student # Get number of students total_average = 0.0 num_students = int(input('How many students do you have? ')) # Get the number of test scores per student num_test_scores = int(input('How many test scores per student? ')) # Determine each student’s average test score for student in range(num_students): # Initialize an accumulator for test scores total = 0.0 # Get a student’s test scores print('Student number', student + 1) print('---------------------------------------------') for test_num in range(num_test_scores): print('Test number', test_num + 1, end=' ') score = float(input(': ')) #add the score to accumulator total += score # Calculate the average test scorefor this student average = total / num_test_scores total_average = average + total_average # Display the average print('The average for student number', student + 1, 'is: ', average) print() print('The class average for all tests is: ', total_average//num_students)